package com.example.tests;

import org.testng.annotations.Test;

import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;

public class GroupCreationTests extends TestBase {
	  
@Test(dataProvider = "groupsFromXmlFile")
  public void testGroupCreationWithValidData(GroupData group) throws Exception {
    app.getGroupHelper().createGroup(group);
    if (wantToCheck()) {
    	if ("yes".equals(app.getProperty("check.db"))) {
    		assertThat(app.getModel().getGroups(), equalTo(app.getHebirnateHelper().listGroups()));
    	}
    	if ("yes".equals(app.getProperty("check.ui"))) {
    		assertThat(app.getModel().getGroups(), equalTo(app.getGroupHelper().getUiGroups()));
    	}
    }	
  }
}
